# import requests
#
# url ='https://www.gying.org/mv?page=2'
#
# headers = {
# 'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
# 'cookie':'PHPSESSID=12j6p32bm5k5p9cv2toge5uad2; BT_auth=96cf3h87EsSFAY_Gh2oP3_wI01a8k-IauVMecLxnQCih-8DkzcVmupPf0i9yIh4aem9_8XFmaqdR07zXWH4d1RpcVTGY8TQNQfAVhy-LFIiov1cvcnjlEzKTdOxObWtxBemhjUCQWdRDD5ahEFAX46Pv46TCmL2GYg3ABTV4MR-zpAbl; BT_cookietime=29c44Hhd9y_uJ6i7WACz2kaucmXyOGfN3A2kmHS77YpnwYPIqrC7; vrg_sc=631b8dacd77940cec42e20f499ab19e9; vrg_go=1'
# }
#
# response = requests.get(url,headers=headers)
# print(response.text)

import requests

session = requests.Session()

headers = {
'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'cookie':'PHPSESSID=12j6p32bm5k5p9cv2toge5uad2; BT_auth=96cf3h87EsSFAY_Gh2oP3_wI01a8k-IauVMecLxnQCih-8DkzcVmupPf0i9yIh4aem9_8XFmaqdR07zXWH4d1RpcVTGY8TQNQfAVhy-LFIiov1cvcnjlEzKTdOxObWtxBemhjUCQWdRDD5ahEFAX46Pv46TCmL2GYg3ABTV4MR-zpAbl; BT_cookietime=29c44Hhd9y_uJ6i7WACz2kaucmXyOGfN3A2kmHS77YpnwYPIqrC7; vrg_sc=631b8dacd77940cec42e20f499ab19e9; vrg_go=1'
}

url ='https://www.gying.org/mv?page=2'
res = session.get(url,headers=headers)
print(res.text)
print(res.status_code)




# https://www.gying.org/


import requests
import re
import json


session = requests.Session()

login_url = 'https://www.gying.org/user/login'

session.post(login_url, data={
    'siteid':1,
    'dosubmit':1,
    "cookietime":10506240,
    "username":"zzy0371",
    "password":"Qikuedu123"
})

# print(response.cookies)

response = session.get('https://www.gying.org/user/favorite')

data = re.search(r'_obj.inlist=(.*?);', response.text)
if data:
    data = data.group(1)
    data = json.loads(data)
    titles = data['t']
    images = data['i']

    for i, t in enumerate(titles):
        print(t, f'https://s.tutu.pm/img/mv/{images[i]}/384.avif')


